package domain.userManagement.models;

import java.util.HashMap;

/**
 *
 * @author peterfrem
 */
public class UserList {
    
    private static HashMap<String, User> userList;
    private static UserList instance = null;
    
    private UserList(){
	
    }
    
    public static UserList getInstance(){
	if(instance == null){
	    instance = new UserList();
	}
	
	return instance;
    }
    
    public void addUser(User user){
	userList.put(user.getUsername(), user);
    }
    
    public User getUser(String username){
	return userList.get(username);
    }
    
    public boolean userExists(String username){
	return userList.containsKey(username);
    }
    
}
